package com.shenmazong.controller;


import com.shenmazong.entity.TbOutline;
import com.shenmazong.service.TbOutlineService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.ListParamVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 大纲表 ——> John
 前端控制器
 * </p>
 *
 * @author 还怕大雨吗
 * @since 2021-09-18
 */
@RestController
@RequestMapping("/tbOutline")
@CrossOrigin
public class TbOutlineController {

    @Resource
    private TbOutlineService tbOutlineService;

    /***
     * @description 查询阶段包含的所有大纲
     * @params [listParamVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/18 15:42
     */
    @PostMapping("/selectTBOutline")
    public ResultResponse selectTBOutline(@RequestBody ListParamVo listParamVo){
        return tbOutlineService.selectTBOutline(listParamVo);
    }

    /***
     * @description 对阶段新增某一个大纲
     * @params [listParamVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/18 15:46
     */
    @PostMapping("/insertTbOutLine")
    public ResultResponse insertTbOutLine(@RequestBody TbOutline tbOutline){
        return tbOutlineService.insertTbOutLine(tbOutline);
    }

    /***
     * @description 对大纲名称进行修改
     * @params [listParamVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/18 15:47
     */
    @PostMapping("/updateTboutLine")
    public ResultResponse updateTboutLine(@RequestBody TbOutline tbOutline){
        return tbOutlineService.updateTboutLine(tbOutline);
    }

    /***
     * @description 删除某一个大纲
     * @params [listParamVo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/18 15:58
     */
    @PostMapping("/deleteTboutLine")
    public ResultResponse deleteTboutLine(Long outLineId){
        return tbOutlineService.deleteTboutLine(outLineId);
    }


    /***
     * @description 查询全部阶段
     * @params [stageNo]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/23 13:40
     */
    @PostMapping("/selectStage")
    public ResultResponse selectStage(Long stageNo){
        System.out.println("stageNo = " + stageNo);
        return tbOutlineService.selectStage(stageNo);
    }
    
    /***
     * @description 查询单个文章详情信息
     * @params [article]
     * @return com.shenmazong.utils.ResultResponse
     * @author -还怕大雨吗
     * @date 2021/9/26 8:57
     */
    @PostMapping("/selectOutline")
    public ResultResponse selectOutline(Long article){
        return tbOutlineService.selectOutline(article);
    }



}

